function getRandomChineseWord() {
  const rsl = '';
  const _randomUniCode1 = `\\u${Math.floor((Math.random() * (40870 - 19968)) + 19968).toString(16)}`;
  const _randomUniCode2 = `\\u${Math.floor((Math.random() * (40870 - 19968)) + 19968).toString(16)}`;
  const _randomUniCode3 = `\\u${Math.floor((Math.random() * (40870 - 19968)) + 19968).toString(16)}`;
  // eslint-disable-next-line no-eval,no-useless-concat
  eval(`rsl="${_randomUniCode1}${_randomUniCode2}${_randomUniCode3}"`);
  return rsl;
}

function Person() {
  this.id = Math.random();
  this.nickname = getRandomChineseWord();
  this.avatar = 'https://file.learnerhub.net/crop-avatar-1606472008217/Web.png';
  this.gender = Math.round(Math.random());
  this.tag_list = Math.round(Math.random()) ? ['标签1', '标签2'] : [];
  this.living = getRandomChineseWord();
  this.vocation = getRandomChineseWord();
  this.company = getRandomChineseWord();
  this.bio = getRandomChineseWord();
  this.attention = !Math.round(Math.random());
}

export default () => {
  const userCount = Math.ceil(Math.random() * 10);
  const users = [];
  for (let i = 0; i < userCount; i += 1) {
    users.push(new Person());
  }
  return users;
};
